package com.wwwarehouse.taskcenter.fragment.job_point.step4;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wwwarehouse.common.activity.base.BaseFragment;
import com.wwwarehouse.common.custom_widget.CircleImageView;
import com.wwwarehouse.common.custom_widget.ElasticScrollView;
import com.wwwarehouse.common.custom_widget.button.StateButton;
import com.wwwarehouse.taskcenter.R;
import com.wwwarehouse.taskcenter.fragment.bluetooth.BluetoothFragment;

/**
 * @创建者 chenchao.
 * @创建时间 2017/10/25 20:08
 * @描述 ${TODO}
 */

public class ChooseConnectBluetoothDisconnectFragment extends BaseFragment implements View.OnClickListener {

    private View mView;
    private ImageView mTaskAddpointStep4Noconnectimg;
    private TextView mTaskAddpointStep4OpenbluetoothTxt;
    private CircleImageView mTaskAddpointStep4Mainimg;
    private TextView mTaskAddpointStep4RelateTxt;
    private ImageView mChooceImg1;
    private View mChooceLineView;
    private ImageView mChooceImg2;
    private LinearLayout mTaskAddpointStep4LineLin;
    private TextView mTaskAddpointStep4Detail1txt;
    private StateButton mTaskAddpointStep4LookdetailStatebtn;
    private StateButton mBtSure;
    private ElasticScrollView mEsvElastic;
    private StateButton detailStateBtn;
       private LinearLayout mainBgLin;
    private TextView mainTitleTxt,mainNumberTxt;
    private boolean isBluetoothConnect = false;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mView = inflater.inflate(R.layout.fragment_choose_connect_biuetooth, container, false);
        initView(mView);
        return mView;
    }

    @Override
    public void setTitle() {
        if (peekFragment() instanceof ChooseConnectBluetoothDisconnectFragment) {
            mActivity.setTitle("" + getString(R.string.new_task_step6_add));
        }
    }

    @Override
    public void requestDatas() {

    }

    private void initView(View mView) {
        mTaskAddpointStep4Noconnectimg = (ImageView) mView.findViewById(R.id.task_addpoint_step4_noconnectimg);
        mTaskAddpointStep4OpenbluetoothTxt = (TextView) mView.findViewById(R.id.task_addpoint_step4_openbluetooth_txt);
        mTaskAddpointStep4Mainimg = (CircleImageView) mView.findViewById(R.id.task_addpoint_step4_mainimg);
        mTaskAddpointStep4RelateTxt = (TextView) mView.findViewById(R.id.task_addpoint_step4_relate_txt);
        mChooceImg1 = (ImageView) mView.findViewById(R.id.chooce_img_1);
        mChooceLineView = (View) mView.findViewById(R.id.chooce_line_view);
        mChooceImg2 = (ImageView) mView.findViewById(R.id.chooce_img_2);
        mTaskAddpointStep4LineLin = (LinearLayout) mView.findViewById(R.id.task_addpoint_step4_line_lin);
        mTaskAddpointStep4Detail1txt = (TextView) mView.findViewById(R.id.task_addpoint_step4_detail_1txt);
        mTaskAddpointStep4LookdetailStatebtn = (StateButton) mView.findViewById(R.id.task_addpoint_step4_lookdetail_statebtn);
        mBtSure = (StateButton) mView.findViewById(R.id.bt_sure);
        mEsvElastic = (ElasticScrollView) mView.findViewById(R.id.esv_elastic);
        detailStateBtn = (StateButton) mView.findViewById(R.id.task_addpoint_step4_detail_statebtn);
        mainBgLin = (LinearLayout)mView.findViewById(R.id.task_addpoint_step4_mainimg_bg_rel);
        mainTitleTxt = (TextView)mView.findViewById(R.id.task_addpoint_step4_mainimg_bg_title);
        mainNumberTxt = (TextView)mView.findViewById(R.id.task_addpoint_step4_mainimg_bg_number);


        detailStateBtn.setVisibility(View.GONE);
        mBtSure.setVisibility(View.GONE);
        mTaskAddpointStep4LookdetailStatebtn.setVisibility(View.VISIBLE);
        mTaskAddpointStep4LookdetailStatebtn.setText("断开链接");

        mTaskAddpointStep4Detail1txt.setVisibility(View.GONE);
        mTaskAddpointStep4RelateTxt.setText("已连接蓝牙指环");

        mTaskAddpointStep4LookdetailStatebtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                popFragment();
                pushFragment(new BluetoothFragment());
            }
        });
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
        return null;
    }
}
